/**
 * 作者：陈文斌 on 2019/1/22.
 * 邮箱：chen_wennbin@163.com
 * 版本：v1.0
 */

import 'package:flutter/material.dart';
import 'package:crm/constant/constant.dart';
import 'package:crm/component/Feedback/user_feedback_record_list_section.dart';
import 'package:crm/page/Feedback/add_feedback_record_page.dart';
import 'package:crm/view/AppBar/custom_app_bar.dart';

const String Title = '用户反馈记录';

class UserFeedbackRecordPage extends StatefulWidget {
  final String customerId;
  final String customerName;

  UserFeedbackRecordPage({
    Key key,
    this.customerId,
    this.customerName,
  }) : super(key: key);

  @override
  State<StatefulWidget> createState() {
    return _UserFeedbackRecordPageState();
  }
}

class _UserFeedbackRecordPageState extends State<UserFeedbackRecordPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: CustomAppBar(
        title: Title,
        actions: <Widget>[
          MaterialButton(
            onPressed: () {
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => AddFeedbackRecordPage(
                        customerId: widget.customerId,
                        customerName: widget.customerName,
                      ),
                ),
              );
            },
            child: Text(
              '添加',
              style: AppStyles.actionsTitleStyle,
            ),
            splashColor: Colors.transparent,
            highlightColor: Colors.transparent,
          ),
        ],
      ),
      body: UserFeedbackRecordListSection(
        customerId: widget.customerId,
      ),
    );
  }
}
